<%--
  User: 黄星
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>

    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/jquery-1.9.1.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/page/admin/lib/layer/2.4/layer.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/page/admin/static/h-ui.admin/js/H-ui.admin.js"></script>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/page/admin/static/h-ui.admin/skin/default/skin.css" id="skin" />
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/utils.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/page/admin/static/h-ui/js/H-ui.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/page/admin/lib/jquery.contextmenu/jquery.contextmenu.r2.js"></script>

    <script type="text/javascript">
        $(function () {

        });

        function updClick() {
            var scoreId =${score.id};
            var scoreResult = $("#scorenumber").val();

            if (scoreResult != "") {
                if (isScore(scoreResult) && scoreResult >= 0 && scoreResult <= 100) {
                    $.ajax({
                        url: "${pageContext.request.contextPath}/ScoreManage/updScore",
                        type: "get",
                        dataType: "text",
                        data: {"id": scoreId, "result": scoreResult},
                        async: false,
                        success: function (message) {
                            parent.layer.msg(message,{icon:1,time:2000});
                            parent.document.getElementById("updFlash").click();
                            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                            parent.layer.close(index); //再执行关闭
                        },
                        error: function (message) {
                            parent.layer.msg(message, {icon: 1, time: 2000});
                        }
                    });
                }
                else {
                    alert("请输入分数在0-100之间");
                }

            } else {
                alert("请输入成绩");
            }
        }

        function layerClose() {
            layer_close();
        }

    </script>
</head>

<style>
    input[type=number]::-webkit-inner-spin-button,
    input[type=number]::-webkit-outer-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }
</style>

<body>
<form>
    <div style="width: 100%;font-size: 20px;float: left">
        学号：${score.student.sno}
    </div>
    <div style="width: 100%;font-size: 20px;float: left">
        姓名：${score.student.studentName}
    </div>
    <div style="width: 100%;font-size: 20px;float: left">
        专业：${score.student.classes.major.majorName}
    </div>
    <div style="width: 100%;font-size: 20px;float: left">
        班级：${score.student.classes.classesName}
    </div>
    <div style="width: 100%;font-size: 20px;float: left">
        科目：${score.subject.subjectName}
    </div>
    <div style="width: 100%;font-size: 20px;float: left">
        分数：<input id="scorenumber" type="number" value="${score.result}">
    </div>
    <div style="width: 100%;font-size: 20px;float: left;margin-left: 10%;">
        <input type="button" value="确定" onclick=updClick()>
        <input type="button" value="取消" onclick="layerClose();">
    </div>
</form>
</body>
</html>
